<?php 
/**
 * @author 3Code 
 * @version 1.5
 * @package Arrow
 * @subpackage Orm
 * @link http://arrowplatform.org/
 * @copyright 2011 3code 
 * @license GNU LGPL
 * 
 * @date 2011-05-01 
*/

abstract class ArrowOrmPersistent implements IObjectFactory, IDataAccess, IPersistency {
	create()=>save()=>
//-------- IObjectFactory methods ----------------
public static function create($initialValues){}
public static function getByKey($key,$objectType=null){}
public static function getByCriteria($criteria=null,$objectType=null){}

//-------- IFieldAccess methods ----------------
public function getValue($field){}
public function setValue($field,$value){}
public function valueExist($field){}
public function unsetValue($field){}

//-------- IPersistency methods ----------------
public function save(){}
public function delete(){}

//-------- Event methods ----------------
/**
 * TODO:: shoud we add events to interfaces ??
 */

/**
 * Additional function called during create (after first save ??)  
 */




/**
 * Additional function called during load of existing object
 */
protected function onLoad($data){}


//on save can exist in two variants before/after
protected function onUpdate($oldDbData, $newDbData){
	
}

protected function onCreate($data){}
protected function onFirstSave($data){}
protected function onDelete($data){}

create>onCreate > save>onFirstSave
save>onUpdate
}
?>